<template>
	<ir-tabs :navs="navs" :multiple="true">
		<template v-slot:page1>
			<u-cell-group v-for="(item,index) in Data3" :key="index">
				<u-cell @click="gomydetail(Data3[index].id)" :border="false" :title="item.villageName"
					:value="item.addTime"></u-cell>
			</u-cell-group>
			<u-empty v-if="Data3.length==0" mode="list" icon="/static/img/什么也没有.png">
			</u-empty>
		</template>

		<template v-slot:page2>
			<u-cell-group v-for="(item,index) in Data3" :key="index" v-if="Data3[index].follow==1">
				<u-cell @click="gomydetail(Data3[index].id)" :border="false" :title="item.villageName"
					:value="item.addTime"></u-cell>
			</u-cell-group>
			<u-empty v-if="yesreturn==0" mode="list" icon="/static/img/什么也没有.png">
			</u-empty>
		</template>

		<template v-slot:page3>
			<u-cell-group v-for="(item,index) in Data3" :key="index" v-if="Data3[index].follow==0">
				<u-cell @click="gomydetail(Data3[index].id)" :border="false" :title="item.villageName"
					:value="item.addTime"></u-cell>
			</u-cell-group>
			<u-empty v-if="noreturn==0" mode="list" icon="/static/img/什么也没有.png">
			</u-empty>
		</template>
	</ir-tabs>
</template>

<script>
	import {
		pageCenter
	} from "../../static/js/api/my.js"
	import {
		inquire
	} from '@/static/js/api/noagricultural.js'
	export default {
		data() {
			return {
				navs: ['全部列表', '已回访记录', '未回访记录'],
				Data: '',
				Data3: '',
				yesreturn: 0,
				noreturn: 0
			}
		},
		mounted() {
			this.beg1()
		},
		methods: {
			async beg1() {
				this.Data = await inquire()
				this.Data3 = this.Data.data.records
				for (var i = 0; i < this.Data3.length; i++) {
					//console.log(this.Data3[i].status);
					if (this.Data3[i].status == 0) {
						this.noreturn++
					} else {
						yesreturn++
					}
				}
			},
			gomydetail(id) {
				uni.navigateTo({
					url: `/pages/mydetail/mydetail?id=${id}`
				})
			},

		}
	}
</script>